
package com.xiaozhi.dao;



import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.xiaozhi.entity.WxOrder;

public interface WxOrderMapper {
    @Insert({"INSERT INTO wx_order (userId,orderId,comboId,count,price,totalPrice,dialogCount,createTime,openId,state)",
     "values (#{userId},#{orderId},#{comboId}, #{count},#{price},#{totalPrice},#{dialogCount},#{createTime},#{openId},#{state}) "})
    //@Options(useGeneratedKeys = true, keyProperty = "id")
    int add(WxOrder order);

    @Update("Update wx_order set state = #{state} where orderId=#{orderId}")
    int update(WxOrder order);

    @Select("select * from wxOrder where orderId = #{orderId}")
    WxOrder selectOederByOrderId(String orderId);


    @Select("select * from wxOrder where userId = #{userId}")
    List<WxOrder> selectOrderByuserId(String userId);
}